Learn R Programming

fda.usc (version 1.1.0)

Depth Multivariate: Provides the depth measure for multivariate data

Description

Compute measure of centrality of the multivariate data. Type of depth function: Mahalanobis depth (MhD), Half-space depth (HD), projection depth (PD) and simplicial depth (SD).
  • Thedepth.HDfunction implements a half-space depth measure based on random projections.
  • Thedepth.MhDfunction implements a Mahalanobis depth measure.
  • Thedepth.PDfunction provides the depth measure using random projections for multivariate data.
  • Thedepth.SDfunction provides the simplicial depth measure for bivariate data.

Usage

depth.HD(x, xx = x, trim = 0.25,  proj = NULL, draw = FALSE) 
depth.MhD(x, xx = x, trim = 0.25, draw = FALSE) 
depth.PD(x,  xx = x, trim = 0.25, proj = NULL, draw = FALSE) 
depth.SD(x,  xx = NULL, trim = 0.25, draw = FALSE)

Arguments

x
is a set of points, a d-column matrix.
xx
is a d-dimension multivariate sample, a d-column matrix.
trim
The alpha of the trimming.
proj
are the directions for random projections, by default 500 random projections generated from a scaled runif(500,-1,1).
draw
=TRUE, draw the curves, the sample median and trimmed mean.

Value

  • medianDeepest point of xx.
  • lmedIndex of deepest element median of xx.
  • mtrimThe average from the (1-trim)% deepest set of points xx.
  • ltrimIndex of set of points x with trimmed mean mtrim.
  • depDepth of each point x w.r.t. xx.
  • dep.oriDepth of each point xx w.r.t. xx.
  • projThe projection value of each point on set of points.

Details

Type of depth measures,
  • Thedepth.HDfunction calculates the half-space depth (HD) of the points inxw.r.t.xxbased on random projectionsproj.
  • Thedepth.MhDfunction calculates the Mahalanobis depth (MhD) of the points inxw.r.t.xx.
  • Thedepth.PDcalculates the projection depth (PD) of the points inxw.r.t.xxbased on random projectionsproj.
  • Thedepth.SDcalculates the simplicial depth (HD) of the points inxw.r.t.xx.
Graphic options,
  • Ifdraw=TRUEand 2-column matrix: draw scatterplot of a multivariate data set specifying a color for one of points in a gray scale of it detph value, the median in red and the trimed mean in yellow.
  • Ifdraw=TRUEand 2
  • Ifdraw=TRUEand d>=6 d-column matrix: star plots of a multivariate data set specifying a color for one of the stars in a gray scale of it detph value.
  • Ifdraw=``pairs''draw pairs plot of a multivariate data set based on its depth (in a gray scale).
  • Ifdraw=``stars''draw star plots of a multivariate data set. specifying a color for one of the stars in a gray scale of it detph value.

References

Li, J., P.C., Cuesta--Albertos, J.A. and Liu, R. DD--Classifier: Nonparametric Classification Procedure Based on DD--plot. Journal of the American Statistical Association (2012), 107, 737--753. Mahalanobis, P. (1936). On the generalized distance in statistics. Proceedings of the National Academy India, 12, 49-55. Liu, R.Y. (1990). {On a notion of data depth based on random simplices}. Annals of Statistics, 18, 405-414. Zuo, Y.J. (2003). Projection based depth functions and associated medians. Annals of Statistics, 31, 1460_1490.

See Also

See Also as depth.FM, depth.mode, depth.RP, depth.RPD and depth.RT.

Examples

Run this code
# data(iris)
# group<-iris[,5]
# x<-iris[,1:2]
                                  
# MhD<-depth.MhD(x,trim=0.1,draw=TRUE)
# PD<-depth.PD(x,trim=0.1,draw=TRUE)
# HD<-depth.HD(x,trim=0.1,draw=TRUE)
# SD<-depth.SD(x,trim=0.1,draw=TRUE)

# x.setosa<-x[group=="setosa",]
# x.versicolor<-x[group=="versicolor",] 
# x.virginica<-x[group=="virginica",]
# d1<-depth.SD(x,x.setosa)$dep
# d2<-depth.SD(x,x.versicolor)$dep
# d3<-depth.SD(x,x.virginica)$dep
# plot(d1,d2,col=as.numeric(group),pch=as.numeric(group))
# plot(d1,d3,col=as.numeric(group),pch=as.numeric(group))
# plot(d2,d3,col=as.numeric(group),pch=as.numeric(group))

Run the code above in your browser using DataLab